// 字面量类型、组合类型
interface Person {
    gender: 'Male' | 'Female',
    name: string,
    age: number,
    country: | { china: true, dosomething: string } | { china: false, apply: string }
}
const person: Person = {
    gender: 'Female',
    name: 'zhangsan',
    age: 18,
    country:
        { china: true, dosomething: "just do it" },
}
// 要确定了chinal的值后，才能确定具体的类型
if (person.country.china) {
    console.log(person.country.dosomething);
} else {
    console.log(person.country.apply);

}
